package data;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class TempManagerInfoDao {
	public static int count(DaoSession daoSession, Map<String,Object> params){
		return (Integer)daoSession.selectOne(
			"FINGERDB_TEMPMANAGERINFO.count", params);		
	}

	public static int countByDeptno(DaoSession daoSession, String deptno){
		HashMap<String,Object> param = new HashMap<String,Object>();
		List<String> deptnos = new ArrayList<String>();
		deptnos.add(deptno);
		param.put("deptnos", deptnos);
		return count(daoSession, param);
	}

	public static int countCheckedByDeptNo(DaoSession daoSession, String deptno){
		return (Integer)daoSession.selectOne(
			"FINGERDB_TEMPMANAGERINFO.countCheckedByDeptNo", deptno);		
	}
	
	@SuppressWarnings("unchecked")
	public static List<TempManagerInfoBean> selectByParam(DaoSession daoSession,
			Map<String,Object> params, int offset, int limit){
		return (List<TempManagerInfoBean>)daoSession.selectList(
			"FINGERDB_TEMPMANAGERINFO.selectManagers", params, offset, limit);		
	}

	public static void insert(DaoSession daoSession, TempManagerInfoBean manager){
		daoSession.insert("FINGERDB_TEMPMANAGERINFO.insert", manager);
	}
	
	public static int delete(DaoSession daoSession, String workno){
		return daoSession.delete("FINGERDB_TEMPMANAGERINFO.delete", workno);
	}
	
	public static TempManagerInfoBean select(DaoSession daoSession, String workno){
		return (TempManagerInfoBean)daoSession.selectOne(
			"FINGERDB_TEMPMANAGERINFO.select", workno);
	}
	
	public static TempManagerInfoBean selectByIdentify(DaoSession daoSession, String identify){
		return (TempManagerInfoBean)daoSession.selectOne(
			"FINGERDB_TEMPMANAGERINFO.selectbyidentify", identify);
	}
}
